When using a limited-size user interface (UI) table to display records stored in a large database table, a page navigation is used to retrieve a set of database records in the table size for table display. The records displayed in the table are usually in a sorted order. When a record lookup in the table is performed, the row index of the record in the sorted data table needs to be obtained for the UI table page navigation and record highlight.
The records in the underlying database table are not stored in any sorting order. There is no row index column in the sorted record table returned by using an SQL by order command. Further, retrieving the row index of a database record in a sorting order while at the same time deleting or inserting rows in the data table may change the indexes of rows.
There are some GetRowIndex methods introduced in some software products. Such a GetRowIndex method either uses a static size data table, or loads the entire data table into memory as a table collection before calling the method for the index lookup. The method has a notice for deleting or inserting rows in the table that may change the indices of rows and does not assume that indices received before such an operation will index the same rows after. The method does not have the capability of handling the index lookup within a dynamic database table.